<?php
require('../../../global.php');
//进入页面后先判断是否有访问权限
checkAdminAuthorizeAndJump('testResult.browse');

if(isset($_GET['id'])){
   
    $result = $db->get('tb_test_result' , '*', array('tbid' => $_GET['id']));
    $testScore = $result['anser'];
    $questionArray = $db->select('tb_question_bank', '*');
    $testScoreArray = explode('|', $testScore);
    $member = $db->get('tb_member', '*',array('tbid' => $result['member_id']));
}
?>
<!DOCTYPE html>
<html>
<head>
    <?php require('admin/_head.php'); ?>
    <title>会员管理 - <?php echo getconfig('title'); ?>管理后台</title>

    <link href="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h3>
                    <button type="button" class="btn btn-white btn-sm closelayer">返回</button>
                    查看会员成绩
                </h3>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <form class="form-horizontal" id="editForm" action="ajax.php">
                            
                           <div class="form-group">
                                <label class="col-sm-2 control-label">微信昵称</label>
                                <div class="col-sm-10">
                                    <p class="form-control-static"><?php echo $member['nickname']; ?></p>
                                </div>
                            </div>
                          <?php
                           if (!empty($questionArray)) {
                               $i = 0;
                               $j = 1;
                               foreach ($questionArray as $value) {
                            
                                   echo '<div class="form-group">
                               <label class="col-sm-2 control-label">第' . $j  . '题</label>
                               <div class="col-sm-10">
                                   <p class="form-control-static">' . $value['question'] . '</p><p class="form-control-static">用户选择的答案:'  . strtoupper($testScoreArray[$i] ) .  '</p></div>
                           </div>'
                                   ;
                                   $i++;
                                   $j++;
                               }
                           }
                          
                          ?> 

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php require('admin/_js.php'); ?>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/content.js?v=1.0.0"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/validform/Validform_min.js"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/validform/Validform_Datatype.js"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/jbase64.js"></script>
    <script>
    $(function(){
        var closeLayer = function(){
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.closeLayer(index);
        }
        $('.closelayer').click(function(event){
            closeLayer();
        });

    });

    </script>
</body>
</html>
